<template>
  <el-dialog
    :close-on-click-modal="false"
    :visible.sync="dialogFormVisible"
    :before-close="handleClose"
    title="新增"
    width="70%">
    <el-form ref="addForm" :model="addForm" :rules="rules" label-width="100px"/>
    <div slot="footer" class="dialog-footer">
      <el-button icon="el-icon-refresh" @click="resetForm('addForm')">重置</el-button>
      <el-button icon="el-icon-plus" type="primary" @click="submitForm('addForm')">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  props: {
    dialogFormVisible: {
      type: Boolean,
      default: Boolean
    }
  },
  data() {
    return {
      // dialogFormVisible: true
      addForm: {},
      rules: {
        orgCode: [
          { required: true, message: '请输入正确的机构编码' }
          // { message: '请输入正确的机构编码', validator: validNumber },
          // { min: 1, max: 20, message: '长度在 1 到 20 个字符' }
        ],
        orgName: [
          { required: true, message: '请输入机构名称' }
          // { message: '数据不能包含特殊字符', validator: validateRequire },
          // { min: 1, max: 85, message: '长度在 1 到 85 个字符' }
        ],
        orgType: [
          { required: true, message: '请选择机构类型', trigger: 'change' }
        ],
        orgNumber: [
          { required: true, message: '请输入正确的机构排序' }
          // { message: '请输入正确的机构排序', validator: validNumber, target: 'blur' },
          // { min: 1, max: 8, message: '长度在 1 到 8 个字符' }
        ],
        orgDesc: [
          // { message: '数据不能包含特殊字符', validator: validSpecial },
          // { min: 1, max: 200, message: '长度在 1 到 200 个字符' }
        ]
      }
    }
  },
  methods: {
    handleClose(done) {
      this.$emit('handleClose')
    },
    resetForm() {

    },
    submitForm() {

    }
  }
}
</script>

<style scoped>

</style>
